{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.title}}</h1></dt>
				<dd>&nbsp;</dd>
				<dd><a href="wood_help.html"><i class="iconfont">&#xe649;</i>帮助文档</a></dd>
			</dl>
		</div>
		<!-- <div class="nav1">
			<ul>
				<a href="works_index.html" class="no"><li>全部产品</li></a>
				<a href="works_index.html"><li>产品分类</li></a>
				<a href="works_index.html"><li>产品分类</li></a>
				<a href="works_index.html"><li>产品分类</li></a>
				<a href="works_index.html"><li>产品分类</li></a>
				<a href="works_index.html"><li>产品分类</li></a>
			</ul>
		</div> -->
		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						<p>密码是MD5加密的,若要修改请重新输入</p>
					</dt>
				</dl>
			</div>

			<form action="" method="get" autocomplete="on" class="form">

				<table class="table1">
					<!-- 控制表格宽度  横向合并 colspan="1"  竖向合并 rowspan="3" -->
					<thead><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th><th width="10%"></th><th width="15%"></th></thead>
					<tr>
						<td rowspan="3" colspan="2" class="center"><img src="{{if .info.pathname}}{{.info.pathname}}{{else}}/static/img/admin/avatar.jpg{{end}}" class="uppic img-3"><input type="file" onchange="uppic(this,'avatar')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg" class="file-3">
							<input type="hidden" name="avatar" value="{{.info.avatar}}"></td>
						<td class="genre">账号</td>
						<td colspan="2">
							<input type="text" class="input95" placeholder="请输入账号！" name="accountnumber" value="{{.info.accountnumber}}">
						</td>
						<td class="genre">密码</td>
						<td colspan="2">
							<input type="password" class="input95" placeholder="请输入密码！" name="password" value="{{.info.password}}">
						</td>
					</tr>
					<tr>
						<td class="genre">权限</td>
						<td colspan="2">
							<select class="select95" name="permission">
								{{range .permission}}
								<option value="{{.id}}">{{.name}}</option>
								{{end}}
							</select>
						</td>
						{{if eq .admin_gid "0"}}
						<td class="genre">所属店铺id</td>
						<td colspan="2">
							<input type="text" class="input70" placeholder="请输入所属店铺id,若为总系统管理员,则输入0！" name="gid" value="{{.info.gid}}" list="gid">
							<datalist id="gid">
							</datalist>
							<button type="button" class="inputbutton" data-type="shop">搜索店铺</button>
						</td>
						{{else}}
						<input type="hidden" name="gid" value="{{.admin_gid}}">
						{{end}}
					</tr>
					<tr>
						<td class="genre">审查</td>
						<td colspan="4">
							<label class="demo--label"><input class="demo--radio" type="radio" name="censoring" value="0" {{if .info}}{{if eq .info.censoring "0"}}checked{{end}}{{else}}checked{{end}}><span class="demo--radioInput"></span>未审查</label>
							<label class="demo--label"><input class="demo--radio" type="radio" name="censoring" value="1" {{if .info}}{{if eq .info.censoring "1"}}checked{{end}}{{end}}><span class="demo--radioInput"></span>已审查</label>
						</td>
					</tr>
					<input type="hidden" name="id" value="{{.info.id}}">
			</form>
					<tr class="trbutton">
						<td colspan="2"><button type="button" class="button">保存</button></td>
						<td colspan="6">
							<p>
								<i class="iconfont">&#xe649;</i> 请检查内容确认发布的内容没有涉及传播谣言、政治话题或违反广告法夸大宣传产品等。
							</p>
							<div class="help">帮助
								<div class="help_qr"><img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/all/qr-code.jpg" alt=""></div>
							</div>
						</td>
					</tr>
				</table>


		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
	$('.button').click(function(){
		if (!$('input[name="accountnumber"]').val()){
			window.wxc.xcConfirm("请输入账号！","info"); return false;
		}
		if (!$('input[name="password"]').val()){
			window.wxc.xcConfirm("请输入密码！","info"); return false;
		}
		var form=$('form').serialize()
		$.ajax({
			url:window.location.href,
			data:form,
			type:'post',
			success:function(res){
				if(res==1){
					 window.wxc.xcConfirm("保存成功","success",{onClose:function(){
                        window.location.href = document.referrer
                    }})
				}else if(res==0){
					 window.wxc.xcConfirm("保存失败,请重试!","error")
				}else if(res==2){
					 window.wxc.xcConfirm("用户名已存在","info")	
				}
			}
		})
	});
</script>
</body>
</html>
